﻿//using System;

//using mvcForum.Core.Interfaces.Search;

//using Lucene.Net.Index;

//using Searcher = Lucene.Net.Search.Searcher;
//using Lucene.Net.Search;

//namespace mvcForum.SearchProvider.Lucene {

//    public class Searcher : ISearcher {

//        public void Search(String query, IList<Int32> forums) {


//            IndexReader indexReader = IndexReader.Open(directory, true);
//            Searcher indexSearch = new IndexSearcher(indexReader);

//            var queryParser = new QueryParser(Version.LUCENE_29, "Make", analyzer);
//            var query = queryParser.Parse("Ford");


//            Console.WriteLine("Searching for: " + query.ToString());
//            TopDocs resultDocs = indexSearch.Search(query, indexReader.MaxDoc());

//            Console.WriteLine("Results Found: " + resultDocs.totalHits);



//            var hits = resultDocs.scoreDocs;
//            foreach (var hit in hits) {
//                var documentFromSearcher = indexSearch.Doc(hit.doc);
//                Console.WriteLine(documentFromSearcher.Get("Make") + " " + documentFromSearcher.Get("Model"));
//            }

//            indexSearch.Close();
//            directory.Close();
//        }
//    }
//}
